package com.gitee.ywj1352.stream.send;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.handler.annotation.SendTo;

@EnableBinding(MySource.class)
public class SendService {

    @Autowired
    private MySource source;

    @SendTo()
    public void sendMsg(String msg){
        source.myOutput().send(MessageBuilder.withPayload(msg).build());
    }
}
